package com.muyan.design.flyweight.compositeflyweight;

//客户端(Client)角色
public class Client {
    private static FlyweightFactory factory;

    public static void main(String[] args) {
        factory = new FlyweightFactory();

        Flyweight fly;
        /*
		 * fly = factory.factory(new Character('a')); fly.operation();
		 * 
		 * fly = factory.factory(new Character('b')); fly.operation();
		 * 
		 * fly = factory.factory(new Character('a')); : fly.operation();
		 */
        fly = factory.factory("abc");
        fly.operation("Composite Call");

        // intrinsic Flyweight
        factory.checkFlyweight();
    }
}
